﻿#ifndef GLOBALVARS_H
#define GLOBALVARS_H

#include "userinfo.h"
#include "hotelinfo.h"
#include "houseinfo.h"
#include "reserveinfo.h"
#include "commentinfo.h"
#include "configoperate.h"
#include "saveinfo.h"
#include <QQueue>
#include <QImage>

enum SELECT_CONDITION{
    SEL_NONE = 0,
    SEL_NUMBER,
    SEL_NAME,
    SEL_SEX,
    SEL_REAL_NAME,
    SEL_PHONE,
    SEL_EMAIL,
};

enum Hotel_Sel_Condition{
    H_Sel_None = 0,
    H_Sel_Number,
    H_Sel_Name,
    H_Sel_City,
    H_Sel_Location,
    H_Sel_User,
};

enum Hotel_Condition{
    H_Select = 0,
    H_Type,
    H_Star,
    H_Mark,
    H_City,
    H_NameOrLocation,
    H_Price,
    H_InTime,
    H_OutTime,
};

enum Hotel_Mark_Condition{
    HMG_5_0 = 1,
    HMG_4_8,
    HMG_4_5,
    HMG_4_2,
    HMG_4_0,
    HML_4_0,
};
enum User_Item{
    USER_NUMBER = 0,
    USER_NAME,
    USER_ROLE,
    USER_CERT,
    USER_REAL_NAME,
    USER_SEX,
    USER_BIRTH,
    USER_PHONE,
    USER_EMAIL,
};

enum Hotel_Item{
    Hotel_Number= 0,
    Hotel_Name,
    Hotel_City,
    Hotel_Location,
    Hotel_Type,
    Hotel_Star,
    Hotel_Mark,
    Hotel_CommentCount,
    Hotel_User,
    Hotel_Phone,
};

enum LogOut_State{
    LogOut_Exit = 0,
    LogOut_Offline,
};

enum COMMAND{
    ///通用请求命令
    CMD_UserRegister_R = 'R',          //用户注册
    CMD_UserLogin_L = 'L',          //用户登录
    CMD_UserInfo_I = 'I',           //获取个人信息
    CMD_UpdateUserInfo_U = 'U',  //更新个人信息
    CMD_BusinessCertificate_C = 'C',  //实名认证 -- 上传图片
    CMD_HeadPic_i = 'i',           //获取头像
    CMD_UploadHeadPic_j = 'j',           //上传头像
    CMD_ModifyPswd_P = 'P',         //修改密码
    CMD_HotelSearch_S = 'S',   //酒店搜索
    CMD_HotelSearchNext_N = 'N',   //酒店搜索下一条数据
    CMD_HotelImageSearch_M = 'M',   //酒店搜索图片
    CMD_HotelImageOrder_o = 'o',   //酒店订单图片
    CMD_HotelImageSave_v = 'v',   //酒店收藏图片
    CMD_HotelImageDetail_t = 't',   //酒店详情图片
    CMD_HotelCredImage_e = 'e',   //酒店证件图片

    CMD_HouseList_H = 'H',   //酒店房间列表
    CMD_HouseListNext_h = 'h',   //酒店房间下一个记录列表
    CMD_HouseImage_T = 'T',   //酒店房间图片

    CMD_SubmitReserve_D = 'D',   //提交订单
    CMD_ReserveList_d = 'd',   //获取订单
    CMD_ReserveDelete_l = 'l',   //删除订单
    CMD_ReserveDetails_a = 'a',   //获取订单详情

    CMD_SubmitComment_p = 'p',   //提交评论
    CMD_CommentList_A = 'A',   //获取评论
    CMD_CommentImage_E = 'E',   //获取评论图片
    CMD_SubmitCommentImage_m = 'm',   //提交评论图片

    CMD_SaveList_s = 's',   //获取收藏
    CMD_DeleteSave_B = 'B',   //删除收藏
    CMD_SubmitSave_c = 'c',   //提交收藏
    CMD_HotelDetailsByID_B = 'b',   //获取酒店详情


    ////////////////////////////////business////////////////////////////////
    CMD_HotelManageList_Z = 'Z',   //获取酒店管理列表
    CMD_HotelManageImage_z = 'z',   //获取酒店管理的图片
    CMD_DeleteHotel_Y = 'Y',   //删除酒店信息 -- 下架酒店
    CMD_DeleteHouse_y = 'y',   //删除酒店房间信息
    CMD_SubmitHotel_W = 'W',   //提交新的酒店信息
    CMD_SubmitHouse_w = 'w',   //提交新的房间信息
    CMD_SubmitHotelImage_Q = 'Q',   //提交新的酒店图片信息
    CMD_SubmitHouseImage_q = 'q',   //提交新的房间图片信息

    CMD_HotelManageIdAndName_V = 'V',   //获取酒店管理的id和名称
    CMD_OrderManageList_x = 'x',   //获取订单管理列表
    CMD_ModifyOrderState_u = 'u',   //修改订单状态

    CMD_SubmitBusComment_r = 'r',   //修改酒店的商家评论

    ////////////////////////////////worker////////////////////////////////
    CMD_UserCert_O = 'O',   //获取实名认证列表
    CMD_UserCertImage_K = 'K',   //获取实名认证图片
    CMD_UserCertResult_J = 'J',   //获取实名认证结果
    CMD_HotelCertResult_K = 'k',   //获取实名认证列表
    CMD_UserExit_X = 'X',           ///用户退出
};

enum USER_ROLE{
    USER_User = 0,
    USER_Business,
    USER_Worker,
    USER_All,
};

enum Msg_Type{
    Msg_Image = 'I',
    Msg_Word = 'W',
};

enum Image_Type{
    Image_HeadPic = 'H',
    Image_ID = 'I',
};

typedef QList<QImage> ImageList;
typedef QMap<QString,QImage> ImageMsgMap;//id + 项目 + 图片
typedef QMap<QString,ImageList::iterator> ImageMap;
typedef QMap<QString, QStringList::iterator> HotelIDMap;  //网络操作使用
class GlobalVars
{
public:
    GlobalVars(){}

public:
    static ConfigOperate g_localConfig;

    static UserInfoMap g_userInfoMap;
    static UserInfoList *g_userInfoList;

    static HotelInfoList *g_hotelInfoList;
    static HotelInfoMap g_hotelInfoMap;

    static HouseInfoList *g_houseInfoList;
    static HouseInfoMap g_houseInfoMap;

    static ReserveInfoList *g_reserveInfoList;
    static ReserveInfoMap g_reserveInfoMap;

    static CommentInfoList *g_commentInfoList;
    static CommentInfoMap g_commentInfoMap;

    static SaveInfoList *g_saveInfoList;
    static SaveInfoMap g_saveInfoMap;

    static QQueue<QString> g_msgQueue; //消息队列
    static QQueue<ImageMsgMap> g_ImageMsgQueue; //消息图像队列
};

#endif // GLOBALVARS_H
